package com.znsb.msfq.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * @name：
 * @author： 孙科技
 * @phone： 13308334117
 * @createTime： 2017/2/9
 * @modifyTime： 2017/2/9
 * @explain：
 */

public class MyPagerSlideTabAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragmentlist;
    private ArrayList<String> titles;

    public MyPagerSlideTabAdapter(FragmentManager fm, List<Fragment> list, ArrayList<String> titles) {
        super(fm);
        this.fragmentlist = list;
        this.titles = titles;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles.get(position);
    }

    @Override
    public int getCount() {
        return fragmentlist.size();
    }

    public Fragment getItem(int position) {
        return fragmentlist.get(position);
    }
}
